<template>
 <el-form :model="form" label-width="auto" style="max-width: 600px">
    <el-form-item label="父级菜单:">
      <el-input v-model="form.parentMenuName" />
    </el-form-item>
     <el-form-item label="菜单名称:">
      <el-input  v-model="form.menuName"/>
    </el-form-item>
     <el-form-item label="跳转的Url地址:">
      <el-input v-model="form.url" />
    </el-form-item>
       <el-form-item>
      <el-button type="primary" @click="onSubmit">Create</el-button>
      <el-button>Cancel</el-button>
    </el-form-item>
  
 </el-form>
</template>

<script setup lang="ts">
import axios, { Axios } from "axios";
import { ElMessage, ElMessageBox } from "element-plus";
import moment from "moment";
import { onMounted, reactive, ref, watch } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useCounterStore } from "@/stores/counter";

const router = useRouter();
const route = useRoute();
const store = useCounterStore();
const form = reactive({
  menuID: 0,
  menuName: "",
  parentMenuName: "",
  parentMenuId: 0,
  url: "",
  createName: store.ccstore.userName,
  createTime: new Date(),
  
  isDel: true,
});

onMounted(() => {
    fMeuns();
})

// 获取菜单
const fMeuns = () => {
    
    axios.get("https://localhost:7174/api/Message/FanTianUpData/FanTianUpData", {
        params: {
            menuID: route.params.menuID,
           
    }})
        .then((res) => {
        console.log(res.data.data.menuName);
        form.menuName=res.data.data[0].menuName;
        form.parentMenuName=res.data.data[0].parentMenuName;
        form.url=res.data.data[0].url;
    })
}
const onSubmit = () => {
  console.log('submit!')
}
</script>

<style scoped>

</style>